#include "screen.h"
#include "Head.h"

static void Turn_Screen_1_2(lv_ui *ui);
static void Turn_Screen_2_1(lv_ui *ui);
static void Turn_Screen_2_3(lv_ui *ui);
static void Turn_Screen_3_1(lv_ui *ui);
static void Turn_Screen_4_1(lv_ui *ui);
static void Turn_Screen_2_4(lv_ui *ui);
_Screen_Turn Screen_Turn={
    .Turn_Screen_1_2=Turn_Screen_1_2,
    .Turn_Screen_2_1=Turn_Screen_2_1,
    .Turn_Screen_2_3=Turn_Screen_2_3,
    .Turn_Screen_3_1=Turn_Screen_3_1,
    .Turn_Screen_4_1=Turn_Screen_4_1,
    .Turn_Screen_2_4=Turn_Screen_2_4    
};

static void Turn_Screen_1_2(lv_ui *ui)
{ 
   Timer_Updata.Timer_Delete(&Timer_Updata);
}

static void Turn_Screen_2_1(lv_ui *ui)
{ 
    lv_obj_set_style_bg_color(ui->screen_slider_c_2, lv_color_hex(Gload_Rgb), LV_PART_INDICATOR|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_slider_c_2, lv_color_hex(White_Rgb), LV_PART_KNOB|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_slider_c_1, lv_color_hex(White_Rgb), LV_PART_KNOB|LV_STATE_DEFAULT);
 
    W_Led.Led_Pointer_To_Lvgl(&W_Led,&guider_ui);
    C_Led.Led_Pointer_To_Lvgl(&C_Led,&guider_ui);    
    Timer_Updata.Timer_Create(&Timer_Updata);
}

static void Turn_Screen_2_3(lv_ui *ui)
{ 
    //Add_Callbak_Function(&guider_ui);
    Led_Channel_1.Init_Data_Screen(&Led_Channel_1,&guider_ui);
    Led_Channel_2.Init_Data_Screen(&Led_Channel_2,&guider_ui);    
}

static void Turn_Screen_2_4(lv_ui *ui)
{ 
    //Add_Callbak_Function_CCT(&guider_ui);
    Led_Channel_1.Init_Data_Screen(&Led_Channel_1,&guider_ui);
    Led_Channel_2.Init_Data_Screen(&Led_Channel_2,&guider_ui);   
}

static void Turn_Screen_3_1(lv_ui *ui)
{
    
    lv_obj_set_style_bg_color(ui->screen_slider_c_2, lv_color_hex(Gload_Rgb), LV_PART_INDICATOR|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_slider_c_2, lv_color_hex(White_Rgb), LV_PART_KNOB|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_slider_c_1, lv_color_hex(White_Rgb), LV_PART_KNOB|LV_STATE_DEFAULT);


    W_Led.Led_Pointer_To_Lvgl(&W_Led,&guider_ui);
    C_Led.Led_Pointer_To_Lvgl(&C_Led,&guider_ui); 
    
    Timer_Updata.Timer_Create(&Timer_Updata);
}


static void Turn_Screen_4_1(lv_ui *ui)
{
    lv_obj_set_style_bg_color(ui->screen_slider_c_2, lv_color_hex(Gload_Rgb), LV_PART_INDICATOR|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_slider_c_2, lv_color_hex(White_Rgb), LV_PART_KNOB|LV_STATE_DEFAULT);
    lv_obj_set_style_bg_color(ui->screen_slider_c_1, lv_color_hex(White_Rgb), LV_PART_KNOB|LV_STATE_DEFAULT);


    W_Led.Led_Pointer_To_Lvgl(&W_Led,&guider_ui);
    C_Led.Led_Pointer_To_Lvgl(&C_Led,&guider_ui); 
    
    Timer_Updata.Timer_Create(&Timer_Updata);    

}

